import { MutableRefObject } from 'react';
import moment from 'moment';
import { extendApi } from '@inbiz/utils';
import type { IProps } from './index';

export default extendApi((_events: MutableRefObject<IProps['callBackEvents']>, props: IProps) => {
  return {
    formateDate: () => {
      return props.value && props.value !== '' ? moment(props.value).format(props.format): null;
    },
  };
});
